package com.example.hao.retrofitplus.utils;

import com.example.hao.retrofitplus.pojo.ResultData;
import com.example.hao.retrofitplus.pojo.User;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.Query;


public interface APIRequestService {

    //http://192.168.3.100:8080/home/register
    @POST("register")
    @FormUrlEncoded//表示需要提交 From 表单数据(POST 键值对)
    Observable<ResultData> register(@Field("userName") String userName, @Field("psw") String psw);

    //baserUrl/register?userName = 值
    @GET("getUser")
    Observable<ResultData<User>> getUser(@Query("userName") String userName);


    @POST("upload")
    @Multipart
    Observable<ResultData> uploadIcon(@Part("content") String content, @Part MultipartBody.Part file);


    @POST("upload")
    @Multipart
    Observable<ResultData> uploadFiles(@Part("content") String content, @Part List<MultipartBody.Part> files);



}
